package com.zego.wawaji.ui.center.transport.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.zego.wawaji.base.data.BaseData;

import org.json.JSONObject;

/**
 * 物流信息
 */
public class StepItemData extends BaseData implements Parcelable{
    private String msg;
    private String date;

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.setMsg(jsonObject.optString("context"));
        this.setDate(jsonObject.optString("time"));
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.msg);
        dest.writeString(this.date);
    }

    public StepItemData() {
    }

    protected StepItemData(Parcel in) {
        this.msg = in.readString();
        this.date = in.readString();
    }

    public static final Creator<StepItemData> CREATOR = new Creator<StepItemData>() {
        @Override
        public StepItemData createFromParcel(Parcel source) {
            return new StepItemData(source);
        }

        @Override
        public StepItemData[] newArray(int size) {
            return new StepItemData[size];
        }
    };
}
